home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / PRPoly.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.6 KB  |  104 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                PRPoly.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PRPOLY_H
  11. #define PRPOLY_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef SLGRDEF_H
  18. #include "SLGrDef.h"
  19. #endif
  20.  
  21. #ifndef SLPTRECT_H
  22. #include "SLPtRect.h"
  23. #endif
  24.  
  25. #ifndef PRGRREF_H
  26. #include "PRGrRef.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Forward Class Declarations
  31. //========================================================================================
  32.  
  33. struct FW_SPoint;
  34. struct FW_SRect;
  35. class ODTransform;
  36.  
  37. //========================================================================================
  38. //    class FW_CPrivPolygonRep
  39. //========================================================================================
  40.  
  41. class FW_CPrivPolygonRep : public FW_CPrivGrRefObj
  42. {
  43. public:
  44.     FW_DECLARE_AUTO(FW_CPrivPolygonRep)
  45.  
  46. //----------------------------------------------------------------------------------------
  47. //    Constructors/Destructors
  48. //
  49. public:
  50.     FW_CPrivPolygonRep(long count, const FW_SPoint* points);
  51.     FW_CPrivPolygonRep(FW_CReadableStream& stream);
  52.     FW_CPrivPolygonRep(const FW_CPrivPolygonRep& poly);
  53.     
  54.     ~FW_CPrivPolygonRep();
  55.  
  56. //----------------------------------------------------------------------------------------
  57. //    Operations
  58. //
  59. public:
  60.     void                    Transform(Environment *ev, ODTransform* transform);
  61.     void                    InverseTransform(Environment *ev, ODTransform* transform);
  62.  
  63.     void                    Move(FW_Fixed deltaX, FW_Fixed deltaY);
  64.     void                    MoveTo(FW_Fixed x, FW_Fixed y);
  65.  
  66.     void                    Inset(FW_Fixed x, FW_Fixed y);
  67.     
  68.     void                     GetBounds(FW_SRect& rect) const;
  69.     
  70.     void                    SetPoints(const FW_SPoint* points,
  71.                                       long startIndex,
  72.                                       long pointCount);
  73.  
  74.     void                    GetPoints(FW_SPoint* points,
  75.                                       long startIndex,
  76.                                       long pointCount) const;
  77.  
  78. //----------------------------------------------------------------------------------------
  79. //    Attributes
  80. //
  81. public:
  82.     long                    GetCount() const;
  83.     FW_SPoint*                GetPoints() const;
  84.  
  85. //----------------------------------------------------------------------------------------
  86. //    Inherited API
  87. //
  88. public:
  89.     void                    Write(FW_CWritableStream& stream) const;
  90.     FW_Boolean                IsEqual(const FW_CPrivPolygonRep* poly) const;
  91.  
  92. //----------------------------------------------------------------------------------------
  93. //    Data Members
  94. //
  95. private:
  96.     long                fCount;
  97.     FW_SPoint*            fPoints;
  98.     
  99.     FW_SRect            fBounds;
  100.     FW_Boolean            fValidBounds;
  101. };
  102.  
  103. #endif
  104.